package org.dant.ant.extension.net.processors;

import org.apache.tools.ant.BuildException;

import org.dant.apache.tools.ant.taskdefs.Execute;

public class StartCxxApp extends StartApp {

  protected Execute prepareExec() throws BuildException {
    if (dir == null) {
      dir = getProject().getBaseDir();
    }
    
    Execute exe = new Execute(createHandler(), createWatchdog());
    exe.setTask(this);
    exe.setProcessKey(getProcessKey());
    exe.setBlocking(getBlocking());
    exe.setExpectList(expectlist);
    exe.setResultsList(resultsList);
    exe.setAntRun(getProject());
    exe.setWorkingDirectory(dir);
    exe.setVMLauncher(vmLauncher);

    exe.setNewenvironment(newEnvironment);
    exe.setEnvironment(envs);
    return exe;
  }

  public String getProcessKey() {
    return this.cmdl.toString();
  }
}
